package com.zang.blogz.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.zang.blogz.dto.ArticleHomeDTO;
import com.zang.blogz.entity.Article;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 朵橙i
 * @since 2022-06-17
 */
@Mapper
public interface ArticleMapper extends BaseMapper<Article> {

    /**
     * 获得首页文章列表
     * @param page 分页插件
     * @param homeDTOQueryWrapper wrapper
     * @return Ipage对象
     */
    IPage<ArticleHomeDTO>  getIndexArticleInfo(IPage<ArticleHomeDTO> page, @Param(Constants.WRAPPER) QueryWrapper<ArticleHomeDTO> homeDTOQueryWrapper);
}
